package jiheyufanxing;

import java.util.HashSet;
import java.util.Set;

public class setexample {
    public static void main(String[] args) {

        Set<Integer> set = new HashSet<>();
        set.add(1);
        set.add(2);
        set.add(3);
        set.add(2);

 
        System.out.println("Elements in the set:");
        for (Integer element : set) {
            System.out.println(element);
        }

  
        boolean containsTwo = set.contains(2);
        System.out.println("\nSet contains 2: " + containsTwo);
    }
}